package com.example.dao;

import com.example.pojo.Dept1;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Dept1Mapper {
    //查询所有
    @Select("select * from dept1")
    List<Dept1> list();
    //新增数据
    @Insert("insert into dept1 (name, create_time, update_time) values (#{name},#{createTime},#{updateTime})")
    void insert(Dept1 dept1);
    //根据id查询
    @Select("select * from dept1 where id=#{id}")
    Dept1 findId(Integer id);
    //修改数据
    @Update("update dept1 set name=#{name},update_time=#{updateTime} where id=#{id}")
    void update(Dept1 dept1);
    //根据id删除数据
    @Delete("delete from dept1 where id=#{id}")
    void deleteById(Integer id);
}
